﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.CMS.TemplateLanguage;
using MethodWorx.CMS.Web;

namespace MethodWorx.CMS.Plugins
{
    public abstract class TmlExtension : IParser
    {
        public string Name { get; set; }
        public Func<CmsRequestContext, IEnumerable<object>, Dictionary<string, object>, object> Parser { get; set; }

        #region IParser Members

        public string[] Parameters { get { return new string[] { }; } }

        public object Parse(CmsRequestContext context, IEnumerable<object> stack, Dictionary<string, object> parameters)
        {
            return Parser.Invoke(context, stack, parameters);
        }

        public string Namespace
        {
            get;
            set;
        }

        #endregion
    }
}
